<div class="form form-horizontal">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'color-form',
	'enableAjaxValidation'=>false,
)); ?>

	<div class="alert alert-info">
        <!-- <a class="close" data-dismiss="alert">×</a> -->
        Fields with <span class="required">*</span> are required.
    </div><!-- /Form filling tips -->

	<?php echo CHtml::errorSummary(
		$model,
		'<a class="close" data-dismiss="alert">×</a><h4 class="alert-heading">Please fix the errors below:</h4>',
		'',
		array('class'=>'alert alert-error',)
	); ?><!-- /Form error summary -->

	<div class="control-group<?php echo ($form->error($model, 'name')) ? ' error' : ''; ?>">
		<?php echo $form->labelEx($model, 'name', array('class'=>'control-label')); ?>
		<div class="controls">
			<?php echo $form->textField($model, 'name', array('size'=>60, 'maxlength'=>64, 'class'=>'input-xlarge')); ?>
			<?php echo $form->error($model,'name', array('class'=>'help-inline')); ?>
		</div>
	</div>

	<div class="control-group<?php echo ($form->error($model, 'hex')) ? ' error' : ''; ?>">
		<?php echo $form->labelEx($model, 'hex', array('class'=>'control-label')); ?>
		<div class="controls">
	        <?php $this->widget('application.extensions.colorpicker.EColorPicker', array(
	            'name'=>'Color[hex]',
	            'value'=>$model->hex,
	            'mode'=>'textfield',
	            'htmlOptions'=>array(
	                'class'=>'txt',
	            ),
	        )); ?>
	        <?php echo $form->error($model,'hex', array('class'=>'help-inline')); ?>
	    </div>
    </div>

	<div class="form-actions">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class'=>'btn btn-large btn-primary')); ?>
	</div>
	
<?php $this->endWidget(); ?>

</div><!-- form -->
